import App from './App'
import store from './store'

import Vue from 'vue'
Vue.config.productionTip = false
// Vue.prototype.$websiteUrl = 'https://ebd.net.cn/';  //线上
// Vue.prototype.$websiteUrl = 'http://192.168.124.26:8891/';  //本地
Vue.prototype.$websiteUrl = 'https://www.wujieaix.com/';  //线上
// Vue.prototype.$webSocket = 'ws://192.168.124.26:8891/';  //本地
Vue.prototype.$webSocket = 'wss://www.wujieaix.com/';  //线上


App.mpType = 'app'

// 引入全局TuniaoUI
import TuniaoUI from 'tuniao-ui'
Vue.use(TuniaoUI)


// 引入TuniaoUI提供的vuex简写方法
let vuexStore = require('@/store/$tn.mixin.js')
Vue.mixin(vuexStore)


// 引入TuniaoUI对小程序分享的mixin封装
let mpShare = require('tuniao-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)

const prePage = ()=>{
	let pages = getCurrentPages();
	let prePage = pages[pages.length - 2];
	// #ifdef H5
	return prePage;
	// #endif
	return prePage.$vm;
}
Vue.prototype.$api = {prePage}; //api

const app = new Vue({
  store,
  ...App
})

// 引入请求封装，将app参数传递到配置中
require('./common/request.js')(app)

app.$mount()